home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 31 / Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso / -seriously_amiga- / sound / aplayer / files / arexx / authorize1.2.aplay < prev    next >
Text File  |  1998-07-16  |  4KB  |  117 lines

  1. /****************************************************************/
  2. /* This is an script for use with Aplayer to write the module's */
  3. /* author to the commentstring.                                 */
  4. /* Install it on a f-button, and when you run it, it will show  */
  5. /* a requester asking you if you want to change the comment.    */
  6. /* The script will save the string as "Author: [the author]"    */
  7. /* (double-quotes not included).                                */
  8. /*                                                              */
  9. /* This script requires the RexxReqTools.library to work. It    */
  10. /* should be included in the ReqTools package.                  */
  11. /* RexxReqTools is Copyright © Rafael D'Halleweyn.              */
  12. /*                                                              */
  13. /* Don't know how to use the main requester?                    */
  14. /* Press the "Help!" gadget for an explanation.                 */
  15. /*                                                              */
  16. /* This tiny script was written by Anders Torin in 1996-07-11.  */
  17. /* If you want to reach me, my e-mail address is:               */
  18. /* anders@artworks.apana.org.au                                 */
  19. /*                                                              */
  20. /* Fixed and debugged by Johan Torin in 96-07-11  :)            */
  21. /*                                                              */
  22. /* If you use this script, why don't you mail me and tell me    */
  23. /* your opinions about it? :)                                   */ 
  24. /****************************************************************/
  25.  
  26. NL='0A'X
  27.  
  28. /* Some initiating stuff */
  29. Address APLAYER
  30. Options Results
  31.  
  32. /* Open RexxReqTools.library */
  33. Call Addlib("rexxreqtools.library", 0, -30, 0)
  34.  
  35. /* Get the module's author, if possible */
  36. GetAuthor
  37. Author = Strip(Result)
  38.  
  39. /* Get the playing module's modlist-number */
  40. GetCMod
  41. If Result = 0 Then Exit
  42.  
  43. /* Get the module's filename */
  44. GetFilename Result 1
  45. Filename = Result
  46.  
  47. /* Get the old commentstring */
  48. Address Command 'C:List "'FileName'" lformat "%c" >T:CommTemp'
  49. If ~Open('TempFile','T:CommTemp') Then Do
  50.    Say 'Could not open temporary file!'
  51.    Exit 20
  52.    End
  53.  
  54. OldComment = Readln('TempFile')
  55. Call Close('TempFile')
  56. Address Command 'C:Delete T:CommTemp >NIL:'
  57.  
  58. Do Forever    /* Main loop */
  59.  
  60.    /* Open a requester and ask for verification */
  61.  
  62.    Msg=      " The old comment happens to be: "|| NL
  63.    Msg=Msg ||" '"OldComment"'"|| NL
  64.    Msg=Msg ||""|| NL
  65.    Msg=Msg ||" The new one will automagically be set to:"|| NL
  66.    Msg=Msg ||" 'Author: "Author"'"
  67.  
  68.    Interpret Call 'rtezrequest(Msg, "_Okay!|_Strip Prefix!|_Help!|_Edit!|_Cancel!", "Authorize1.2 by Anders Torin", ''rt_reqpos = reqpos_centerscr'')'
  69.    Msg = ''
  70.    If rtresult = 0 Then Exit
  71.  
  72.  
  73.    If rtresult = 1 Then Do
  74.       /* Write the commentstring, w/ 'Author:' in front. */
  75.       Address Command 'C:FileNote "'Filename'" "Author: 'Author'"'
  76.       Exit 0
  77.       End
  78.  
  79.    If rtresult = 2 Then Do
  80.       /* Write the commentstring */
  81.       Address Command 'C:FileNote "'Filename'" "'Author'"'
  82.       Exit 0
  83.       End
  84.  
  85.    If rtresult = 3 Then Do
  86.  
  87.       Help=     " Just pressing 'Okay!' will save the module's author to " || NL
  88.       Help=Help ||" the file like this: " || NL
  89.       Help=Help ||"    'Author: " Author"'. " || NL
  90.       Help=Help ||"" || NL
  91.       Help=Help ||" If you don't want that 'Author: ' prefix, just press the " || NL
  92.       Help=Help ||" 'Strip Prefix!' button. Then it will only be:" || NL
  93.       Help=Help ||"    '"Author"'." || NL
  94.       Help=Help ||"" || NL
  95.       Help=Help ||" Pressing 'Help!' will show this box. " || NL
  96.       Help=Help ||"" || NL
  97.       Help=Help ||" If you want to change the line being saved to the" || NL
  98.       Help=Help ||" commentstring, then use the 'Edit!' button." || NL
  99.       Help=Help ||"" || NL
  100.       Help=Help ||" If you don't want to do anything of this, hit the" || NL
  101.       Help=Help ||" 'Cancel' button."
  102.  
  103.       Interpret Call 'rtezrequest(Help, "Ok, I got it!", "Helprequester from Authorize1.2", ''rt_reqpos = reqpos_centerscr'')'
  104.       Help = ''
  105.       End
  106.  
  107.  
  108.    If rtresult = 4 Then Do
  109.  
  110.       /* Put up a stringrequester */
  111.       Interpret "NewAuthor = rtgetstring(Author, , 'Enter the new author:', ,'rt_reqpos = reqpos_centerscr')"
  112.       If rtresult = 1 Then Author = NewAuthor
  113.  
  114.       End
  115.  
  116. End    /* Main Loop */
  117.